﻿@model S4Store.Models.CarKpi.InputCarKpiDayDataModel
@{
    Layout = null;
    ViewBag.Title = "InputSellerKpiDayData";
    S4Store.Domain.Administrator CurrentUser = (S4Store.Domain.Administrator)ViewBag.CurrentUser;
}

<form class="pageForm addpage" action="@Url.Action("ModifyBackInputCarKpiDayData")" method="post">

<div style=" height:100%; width:100%; overflow:hidden" class="verticalSplitContainer">
    <div class="" style="overflow: auto;" ratio="#100">
        <table class="rpttable" style="border-collapse: collapse;">
            <tr height="40"  class="vtr">
 <th class="yellow" rowspan="2" ><div class="wd20 pd44">车型</div></th>
  <th class="yellow" rowspan="2" ><div class="wd110 pd44">车款</div></th>
  <th class="yellow" colspan="2"><div class="pd44">订车</div></th>
  <th class="yellow" colspan="5"><div class="pd44">库存</div></th>
  <th class="yellow" colspan="2"><div class="pd44">交车</div></th>
  <th class="yellow" colspan="3"><div class="pd44">当日累计有<br/>望客户总数</div></th>
  <th class="yellow" colspan="3"><div class="pd44">当日新增有<br/>望客户总数</div></th>
  <th class="yellow"><div class="pd44">保险</div></th>
  <th class="yellow"><div class="pd44">置换</div></th>
  <th class="yellow"><div class="pd44">金融</div></th>
  <th class="yellow"><div class="pd44">延保</div></th>
  @if (Model.Date.Day <= 10)
  {
  <th rowspan="2" class="yellow"><div class="wd30 pd44"><div class="wd20">上旬套餐车销量</div></div></th>
  }
  else if (Model.Date.Day <= 20)
  {
  <th rowspan="2" class="yellow"><div class="wd30 pd44"><div class="wd20">中旬套餐车销量</div></div></th>
  }
  else
  {
  <th rowspan="2" class="yellow"><div class="wd30 pd44"><div class="wd20">下旬套餐车销量</div></div></th>
  }
  <th rowspan="2" class="yellow"><div class="wd30 pd44"><div class="wd20">装潢车装潢台次</div></div></th>
  <th rowspan="2" class="yellow"><div class="wd40 pd44"><div class="wd20">装潢车装潢总额</div></div></th>
 </tr>
 <tr>
  <th class="yellow" ><div class="wd30 pd44">二网</div></th>
 <th class="yellow" ><div class="wd30 pd44">本店</div></th>
  <th class="yellow" ><div class="wd30 pd44">A类</div></th>
  <th class="yellow" ><div class="wd30 pd44">B类</div></th>
  <th class="yellow" ><div class="wd30 pd44">C类</div></th>
  <th class="yellow" ><div class="wd30 pd44">C类最高库龄</div></th>
  <th class="yellow" ><div class="wd30 pd44">在途</div></th>
  <th class="yellow" ><div class="wd30 pd44">二网</div></th>
  <th class="yellow" ><div class="wd30 pd44">本店</div></th>
  <th class="yellow" ><div class="wd30 pd44">H级</div></th>
  <th class="yellow" ><div class="wd30 pd44">A级</div></th>
  <th class="yellow" ><div class="wd30 pd44">B级</div></th>
  <th class="yellow" ><div class="wd30 pd44">H级</div></th>
  <th class="yellow" ><div class="wd30 pd44">A级</div></th>
  <th class="yellow" ><div class="wd30 pd44">B级</div></th>
  <th class="yellow" ><div class="wd30 pd44">当日投保</div></th>
  <th class="yellow" ><div class="wd30 pd44">当日置换</div></th>
  <th class="yellow" ><div class="wd30 pd44">当日按揭</div></th>
  <th class="yellow" ><div class="wd30 pd44">当日延保</div></th>
 </tr>
 </table>
 </div>

<div class="" style="overflow: auto;" ratio="*">
 <table  class="rpttable"  style="border-collapse:collapse;">

        <input type="hidden" value="@Model.Date.Year" name="y" />
        <input type="hidden" value="@Model.Date.Month" name="m" />
        <input type="hidden" value="@Model.Date.Day" name="d" />
     @{int index = -1;}
     @foreach (var brand in Model.CarBrands)
     {
         var models = Model.GetCardModel(brand);// brand.EnableCarModels.ToList();
         if (models.Count == 0) { continue; }
         for (int i = 0; i < models.Count; i++)
         {
             index++;
             var cm = models[i];
             var daydata = Model.GetDayData(cm.Id);
             <tr>
                        @if (i == 0)
                        {
                            <th rowspan="@models.Count"><div class="wd20 pd44">@brand.Name</div></th>
                        }
             <th><div class="wd110 pd44">@cm.Name
                 <input type="hidden" value="@cm.Id" class="w100 ipt numberinput" name="rows[@(index)].CarModelId" />
                 <input type="hidden" name="rows[@(index)].Date" value="@daydata.Date.ToString("yyyy-MM-dd")" /></div>
             </th>
              
                 <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].EWYD" value="@daydata.EWYD" class="w20 ipt intinput" /></div></td>
                 <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].BDYD" value="@daydata.BDYD" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].AKC" value="@daydata.AKC" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].BKC" value="@daydata.BKC" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].CKC" value="@daydata.CKC" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].CKL" value="@daydata.CKL" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].ZT" value="@daydata.ZT" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].EWYJ" value="@daydata.EWYJ" class="w20 ipt intinput" /></div></td>
            <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].BDYJ" value="@daydata.BDYJ" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].HYWKH" value="@daydata.HYWKH" class="w20 ipt intinput" /></div></td>
            <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].AYWKH" value="@daydata.AYWKH" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].BYWKH" value="@daydata.BYWKH" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].HDJKH" value="@daydata.HDJKH" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].ADJKH" value="@daydata.ADJKH" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].BDJKH" value="@daydata.BDJKH" class="w20 ipt intinput" /></div></td>
           <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].TB" value="@daydata.TB" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].ZH" value="@daydata.ZH" class="w20 ipt intinput" /></div></td>
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].AJ" value="@daydata.AJ" class="w20 ipt intinput" /></div></td>
                 <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].YB" value="@daydata.YB" class="w20 ipt intinput" /></div></td>
                 @if (daydata.Date.Day <= 10)
                 {
                 <td><div class="wd30 pd44">
                     @if (daydata.IsLstTenVersion)
                     {
                         <input type="text" name="rows[@(index)].LstTenVersion" value="@daydata.LstTenVersion" class="w20 ipt intinput" />
                     }
                 </div></td>
                 }
                 else if (daydata.Date.Day <= 20)
                 {
                 <td><div class="wd30 pd44">
                     @if (daydata.IsMidTenVersion)
                     {
                         <input type="text" name="rows[@(index)].MidTenVersion" value="@daydata.MidTenVersion" class="w20 ipt intinput" />
                     }
                  </div></td>}
                 else
                 {
                 <td><div class="wd30 pd44">
                     @if (daydata.IsLastTenVersion)
                     {
                         <input type="text" name="rows[@(index)].LastTenVersion" value="@daydata.LastTenVersion" class="w20 ipt intinput" />
                     }
                 </div></td>}
             <td><div class="wd30 pd44"><input type="text" name="rows[@(index)].NotPackageDecorateCount" value="@daydata.NotPackageDecorateCount" class="w20 ipt intinput" /></div></td>
             <td><div class="wd40 pd44"><input type="text" name="rows[@(index)].NotPackageDecorateValue" value="@daydata.NotPackageDecorateValue" class="w30 ipt numberinput" /></div></td>
             </tr>
         }
            <tr><td colspan="25" style="background:#757576; height:2px; padding:0"></td></tr>
     }
 </table>
 
 </div>
       
    @if (!Model.IsConfirmed || CurrentUser.Position == S4Store.Domain.Position.SystemManager)
    {
        <div class="formBar" ratio="#30">
            <ul>
                <li><div class="simplebutton"><div class="r"><button type="button" class="submit">保存</button></div></div></li>	
                <li>确认数据：<input type="checkbox" name="isconfirm" value="true" /></li>	
            </ul>
        </div>
    }
</div>
</form>